package com.flute.icrawler.framework.framework;

import java.util.HashMap;

public class UrlDeep {
	private int maxDeep;
	private HashMap<String, Integer> deepMaps;

	public UrlDeep() {
		this.deepMaps = new HashMap<String, Integer>();
	}

	public void recordDeep(String url, int deep) {
		this.deepMaps.put(url, deep);
		if(deep>maxDeep){
			this.maxDeep = deep;
		}
	}

	public boolean isUrlRecorded(String url) {
		return deepMaps.containsKey(url);
	}

	public int getDeep(String url) {
		if (deepMaps.containsKey(url)) {
			return deepMaps.get(url);
		}

		return -1;
	}
	
	public int getMaxDeep(){
		return maxDeep;
	}
}
